﻿Public Class viewprofile2
    Inherits System.Web.UI.Page

	Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
		If Not Page.IsPostBack Then
			If GlobalApp.ProfileInfo IsNot Nothing Then
				LoadData()
			End If
		End If
	End Sub

	Private Sub LoadData()
		Dim registerInfo As Entity.OfficerInfoItem
		registerInfo = GlobalApp.ProfileInfo
		With registerInfo

			Me.OFFICER_SPONSOR.Text = .officer_sponsor_appid
			Me.OFFICER_SPONSOR_NAME.Text = .officer_sponsor_name
			Me.OFFICER_SPONSOR_SURENAME.Text = .officer_sponsor_surename
			Me.OFFICER_SPONSOR_TEL.Text = .officer_sponsor_tel

			Me.OFFICER_SENDER.Text = .officer_sender_appid
			Me.OFFICER_SENDER_NAME.Text = .officer_sender_name
			Me.OFFICER_SENDER_SURENAME.Text = .officer_sender_surename
			Me.OFFICER_SENDER_TEL.Text = .officer_sender_tel

			Me.OFFICER_UPLINE.Text = .officer_upline_appid
			Me.OFFICER_UPLINE_NAME.Text = .officer_upline_name
			Me.OFFICER_UPLINE_SURENAME.Text = .officer_upline_surename
			Me.OFFICER_UPLINE_TEL.Text = .officer_upline_tel
			Me.OFFICER_UPLINE_EMPTYSIDE.Text = .officer_upline_emptyside

			If Not String.IsNullOrEmpty(OFFICER_UPLINE_EMPTYSIDE.Text) Then
				If OFFICER_UPLINE_EMPTYSIDE.Text.Equals("L") Then
					OFFICER_UPLINE_EMPTYSIDE.Text = "ซ้าย"
				ElseIf OFFICER_UPLINE_EMPTYSIDE.Text.Equals("R") Then
					OFFICER_UPLINE_EMPTYSIDE.Text = "ขวา"
				End If
			End If

		End With
	End Sub

	Protected Sub btnNext_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnNext.Click
		Response.Redirect("viewprofile3.aspx", False)
	End Sub

	Protected Sub btnBack_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnBack.Click
		Response.Redirect("viewprofile1.aspx", False)
	End Sub

	Protected Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click
		GlobalApp.RemoveProfileInfo()
		Response.Redirect("mainpage.aspx", False)
	End Sub

End Class